using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace WordsHelper.Model.Data
{
    [Serializable]
    public class ModelDataTable : ICloneable
    {
        /// <summary>
        /// "Not Nullable"
        /// </summary>
        public Int32 ID { get; set; }
        /// <summary>
        /// "Not Nullable"
        /// </summary>
        public String Name { get; set; }
        /// <summary>
        /// "Not Nullable"
        /// </summary>
        public String Meaning { get; set; }
        /// <summary>
        /// "Not Nullable"
        /// </summary>
        public Int32 Important { get; set; }

        public object Clone()
        {
            using (var stream = new MemoryStream())
            {
                var formatter = new BinaryFormatter();
                formatter.Serialize(stream, this);
                stream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(stream);
            }
        }
    }
}